﻿using TaoSH.AppCode;
using TaoSH.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TaoSH.View
{
    public partial class SPLBSX : FormUControl
    {




        #region//添加页面

        public override void initAddForm(string strFormCode)
        {
            conLeiBie.Items.Insert(0, new ListItem("请选择", ""));

        }


        public override void initALLForm(string strFormCode)
        {
            base.initALLForm(strFormCode);
            new BLLHelp.BindData().BindSPLB(conLeiBie, "0");
        }



        /// <summary>
        /// 送审表单
        /// </summary>
        /// <param name="FormID">表单号</param>
        /// <param name="intProcessInstanceID">流程号</param>
        /// <returns></returns>
        public override bool SaveForm(int intFormID, string strActionType)
        {
            PT_Pro_Category_SX MODEL = new PT_Pro_Category_SX();
            MODEL = new PT_Pro_Category_SXB().GetEntity(d => d.ID == intFormID);
            MODEL.LB1 = conLeiBie.SelectedItem.Text;
            MODEL.LB2 = conZLeiBie.SelectedItem.Text;
            MODEL.SXName = conSXName.Text;
            MODEL.SXValue = hidJsonData.Value;
            return new PT_Pro_Category_SXB().Update(MODEL);
        }
        #endregion

        #region//查看页面
        /// <summary>
        /// 初始化View页面
        /// </summary>
        /// <param name="intFormID">表单号</param>
        public override void initMangerForm(int intFormID)
        {
            PT_Pro_Category_SX MODEL = new PT_Pro_Category_SX();
            MODEL = new PT_Pro_Category_SXB().GetEntity(d => d.ID == intFormID);
            conLeiBie.SelectedItem.Text = MODEL.LB1;
            new BLLHelp.BindData().BindSPLB(conZLeiBie, conLeiBie.SelectedValue);

            conZLeiBie.SelectedItem.Text = MODEL.LB2;
            conSXName.Text = MODEL.SXName;
            hidJsonData.Value = MODEL.SXValue;
        }

        #endregion

        protected void conLeiBie_SelectedIndexChanged(object sender, EventArgs e)
        {
            new BLLHelp.BindData().BindSPLB(conZLeiBie, conLeiBie.SelectedValue);

        }



    }
}